import 'package:twelve_animals/global.dart';
import 'package:flutter/material.dart';

class Avatar extends StatefulWidget {
  Avatar({Key key, this.sex, this.index, this.size, this.shadow = true})
      : super(key: key);
  final int sex;
  final index;
  final double size;
  final bool shadow;

  @override
  _AvatarState createState() => _AvatarState();
}

class _AvatarState extends State<Avatar> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      width: widget.size ?? 80,
      height: widget.size ?? 80,
      padding: EdgeInsets.all(7),
      decoration: BoxDecoration(
        // gradient: LinearGradient(
        //   begin: Alignment.topCenter,
        //   end: Alignment.bottomCenter,
        //   colors: [
        //     Global.mainColor.withOpacity(0.5),
        //     Global.mainColor,
        //   ],
        // ),
        color: Colors.white.withOpacity(0.4),
        borderRadius: BorderRadius.circular(20),
        boxShadow: [
          BoxShadow(
            color: Color(0xFF000000).withOpacity(0.1),
            offset: Offset(1, 10),
            blurRadius: 5,
            spreadRadius: 1,
          )
        ],
      ),
      child: Image.network(
          'https://m.xzw.com/static/public/images/prot_icon/sx/a/${widget.index.toString()}.png'),
    );
  }
}
